﻿<Controls:SinacorWindow xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
          xmlns:Custom="http://schemas.xceed.com/wpf/xaml/datagrid"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
          mc:Ignorable="d"
          xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
          xmlns:Validation="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Validation;assembly=Sinacor.Infra.UI.Controls"
          WindowStartupLocation="CenterScreen" 
          WindowState="Maximized" 
          Title="{DynamicResource Bovespa.Alocacao.Label.AlocacaoDireta}" 
          x:Class="Sinacor.UI.Bovespa.Alocacao.View.SmartClient.AlocacaoDireta" 
          ModulePlus="False"
          ModuleId="BOL">
    
    <Controls:SinacorExpanderContainer>
        <Controls:SinacorExpanderContainer.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="*" />
        </Controls:SinacorExpanderContainer.RowDefinitions>

        <Controls:SinacorExpander Header="{DynamicResource Bovespa.Alocacao.Label.Pesquisa}" 
								  VerticalAlignment="Top" 
								  Grid.Row="0" 
								  IsExpanded="True">
            <Grid>
                <Controls:SinacorLabel HorizontalAlignment="Left" 
									   Content="{DynamicResource Bovespa.Alocacao.Label.Pregao}" 
									   Width="65" 
									   Margin="0,4,0,0" />
                <Controls:SinacorComboBox Margin="69,4,0,0" 
                                          TabIndex="1" 
                                          HorizontalAlignment="Left" 
                                          VerticalAlignment="Top" 
                                          Width="112"
                                          x:Name="cmbPregao"
                                          ItemsSource="{Binding ListaCalendarios}"
                                          DisplayMemberPath="DataPregaoFormatada"
                                          SelectedValuePath="DataPregao"
                                          SelectedValue="{Binding Path=Filtro.DataPregao}"
                                          IsRequired="True"
                                          />
                <Controls:SinacorLabel Width="90" 
									   Content="{DynamicResource Bovespa.Alocacao.Label.Bolsa}" 
									   Margin="178,4,0,0" 
                                       HorizontalAlignment="Left"/>
                <Controls:SinacorComboBox VerticalAlignment="Top" 
										  Margin="272,4,0,0" 
										  Width="212" 
										  TabIndex="2" 
										  WidthPopup="280"
                                          x:Name="cmbBolsa"
                                          ItemsSource="{Binding Path=ListaBolsas}"
                                          SelectedValue="{Binding Filtro.Bolsa}"
                                          DisplayMemberPath="Descricao"
                                          SelectedValuePath="Codigo" 
                                          HorizontalAlignment="Left"/>
                <Controls:SinacorLabel Width="90" 
									   Content="{DynamicResource Bovespa.Alocacao.Label.NNegocio}" 
									   Margin="488,4,0,0" 
									   VerticalAlignment="Top" 
                                       HorizontalAlignment="Left"/>
                <Controls:SinacorInt32TextBox HorizontalAlignment="Left" 
                                              Value="{Binding Path=Filtro.NumeroNegocio}"
                                              Margin="582,4,0,0" 
                                              Width="75" 
                                              TabIndex="3" 
                                              Integers="9"
                                              IsFormated="False" 
                                              VerticalAlignment="Top"
                                              x:Name="txtNrNegocio"/>
                <Controls:SinacorLabel Width="65" 
									   Content="{DynamicResource Bovespa.Alocacao.Label.Ativo}" 
									   Margin="0,29,0,0" 
									   HorizontalAlignment="Left" 
                                       VerticalAlignment="Top"/>
                <Controls:SinacorTextBox x:Name="txtAtivoAlocacao"
                                                     Text="{Binding Path=Filtro.CodigoNegocio}"
                                                     VerticalAlignment="Top"
												     Width="85" 
													 Margin="69,29,0,0"
													 HorizontalAlignment="Left"
                                                     MaxLength="12"
													 TabIndex="4"/>
                <Controls:SinacorButton x:Name="btnPesquisaAtivosAlocacao"
                                                    OnBufferedClick="btnPesquisaAtivosAlocacao_OnBufferedClick"
                                                    HorizontalAlignment="Left" 
												    VerticalAlignment="Top" 
													Icon="IconButtonSearch" 
													Margin="158,29,0,0" 
													ToolTip="{DynamicResource Bovespa.Alocacao.Label.PesquisarAtivo}" 
													TabIndex="5"/>
                <Controls:SinacorLabel Width="90" 
									   Content="{DynamicResource Bovespa.Alocacao.Label.Mercado}" 
									   Margin="178,29,0,0" 
									   VerticalAlignment="Top" 
                                       HorizontalAlignment="Left"/>
                <Controls:SinacorComboBox HorizontalAlignment="Left" 
										  Margin="272,29,0,0" 
										  Width="212" 
                                          WidthPopup="280"
										  TabIndex="6" 
                                          x:Name="cmbMercado"
                                          
                                          SelectedValue="{Binding Path=Filtro.Mercado}"
                                          VerticalAlignment="Top"/>
                <Controls:SinacorLabel HorizontalAlignment="Left" 
									   Width="90" 
									   Content="{DynamicResource Bovespa.Alocacao.Label.Cliente}" 
									   Margin="488,29,0,0" 
                                       VerticalAlignment="Top"/>
                <Controls:SinacorTextBox HorizontalAlignment="Left" 
                                         Margin="582,29,0,0"  
                                         TabIndex="7"  
                                         Width="75" 
                                         VerticalAlignment="Top"
                                         x:Name="txtCliente"
                                         Text="{Binding Filtro.Cliente}"/>
                <Controls:SinacorGroupBox Width="236" 
										  Height="50" 
										  HorizontalAlignment="Left" 
										  VerticalAlignment="Top" 
										  Header="{DynamicResource Bovespa.Alocacao.Label.NaturezaDaOperacao}" 
										  Margin="661,0,0,0">
                    <Grid HorizontalAlignment="Left" 
						  VerticalAlignment="Top">
                        <Controls:SinacorRadioButton Width="100" 
													 Content="{DynamicResource Bovespa.Alocacao.Label.Compra}" 
													 HorizontalAlignment="Left" 
													 VerticalAlignment="Top" 
													 TabIndex="8"
                                                     x:Name="rdbCompra"
                                                     IsChecked="True"/>
                        <Controls:SinacorRadioButton Width="100" 
													 Content="{DynamicResource Bovespa.Alocacao.Label.Venda}" 
													 Margin="104,0,0,0" 
													 HorizontalAlignment="Left" 
													 VerticalAlignment="Top" 
													 TabIndex="9"
                                                     x:Name="rdbVenda"/>
                    </Grid>
                </Controls:SinacorGroupBox>
                <Controls:SinacorButton HorizontalAlignment="Left" 
									    VerticalAlignment="Top" 
										Content="{DynamicResource Bovespa.Alocacao.Label.Pesquisar}" 
										Margin="693,54,0,0" 
										IsDefault="True" 
										TabIndex="10"
                                        x:Name="btnPesquisar"
                                        Click="btnPesquisar_Click"
                                        CausesValidation="True"/>
                <Controls:SinacorButton HorizontalAlignment="Left" 
										Margin="797,54,0,0" 
										VerticalAlignment="Top" 
										Content="{DynamicResource Bovespa.Alocacao.Label.NovaPesquisa}" 
										TabIndex="11"
                                        x:Name="btnNovaPesquisa"
                                        Click="btnNovaPesquisa_Click"/>
            </Grid>
        </Controls:SinacorExpander>

        <Controls:SinacorExpander Name="NegociosAlocados" 
                                  Header="{DynamicResource Bovespa.Alocacao.Label.NegociosAlocados}" 
								  Grid.Row="1" 
								  Margin="0,4,0,0" 
								  AllowExpand="True" 
								  IsExpanded="True">
            <Grid>
                <Controls:SinacorDataGrid x:Name="dtgNegocios"
                                          ItemsSource="{Binding ListaAlocados}"
                                          AllowDelete="True"
                                          Deleting="dtgNegocios_Deleting" 
                                          TabIndex="12">
                    <Controls:SinacorDataGrid.Columns>
                        <Controls:Column Name="Cliente"
                                         Title="Bovespa.Alocacao.Label.Cliente"
										 AutoAdjustWidthToContent="False"
										 Width="80"
                                         DisplayMemberPath="DadosAlocacao.Cliente"/>
                        <Controls:Column Name="DV"
                                         Title="Bovespa.Alocacao.Label.DV"
										 AutoAdjustWidthToContent="False"
										 Width="25"
										 HorizontalCellAlignment="Center"
                                         DisplayMemberPath="DadosAlocacao.DigitoVerificadorCliente"/>
                        <Controls:Column Name="NNegocio"
                                         Title="Bovespa.Alocacao.Label.NNegocio"
										 AutoAdjustWidthToContent="False"
										 Width="100"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="Negocio.Numero"/>
                        <Controls:Column Name="Bolsa"
                                         Title="Bovespa.Alocacao.Label.Bolsa"
										 AutoAdjustWidthToContent="False"
										 Width="40"
										 HorizontalCellAlignment="Center"
                                         DisplayMemberPath="Negocio.Bolsa"/>
                        <Controls:Column Name="Ativo"
                                         Title="Bovespa.Alocacao.Label.Ativo"
										 AutoAdjustWidthToContent="False"
										 Width="120"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="Negocio.Codigo"/>
                        <Controls:Column Name="NatOperacao"
                                         Title="Bovespa.Alocacao.Label.NatOperacao"
										 AutoAdjustWidthToContent="False"
										 Width="80"
										 HorizontalCellAlignment="Center"
                                         DisplayMemberPath="Negocio.NaturezaOperacao"/>
                        <Controls:Column Name="Preco"
                                         Title="Bovespa.Alocacao.Label.Preco"
										 AutoAdjustWidthToContent="False"
										 Width="160"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="Negocio.Valor"/>
                        <Controls:Column Name="Quantidade"
                                         Title="Bovespa.Alocacao.Label.Quantidade"
										 AutoAdjustWidthToContent="False"
										 Width="130"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="Negocio.Quantidade"/>
                        <Controls:Column Name="TipoLiq"
                                         Title="Bovespa.Alocacao.Label.TipoLiq"
										 AutoAdjustWidthToContent="False"
										 Width="80"
                                         DisplayMemberPath="DadosAlocacao.Direcionado.TipoLiquidacao"/>
                        <Controls:Column Name="Carteira"
                                         Title="Bovespa.Alocacao.Label.Carteira"
										 AutoAdjustWidthToContent="False"
										 Width="50"
                                         DisplayMemberPath="DadosAlocacao.Carteira"/>
                        <Controls:Column Name="Mercado"
                                         Title="Bovespa.Alocacao.Label.Mercado"
										 AutoAdjustWidthToContent="False"
										 Width="55"
                                         DisplayMemberPath="Negocio.Mercado"/>
                        <Controls:Column Name="UsuarioDirecionado"
                                         Title="Bovespa.Alocacao.Label.UsuarioDirecionado"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="DadosAlocacao.Direcionado.Usuario"/>
                        <Controls:Column Name="ClienteDirecionado"
                                         Title="Bovespa.Alocacao.Label.ClienteDirecionado"
                                         DisplayMemberPath="DadosAlocacao.Direcionado.Cliente"/>
                        <Controls:Column Name="DV2"
                                         Title="Bovespa.Alocacao.Label.DV"
										 AutoAdjustWidthToContent="False"
										 Width="25"
										 HorizontalCellAlignment="Center"
                                         DisplayMemberPath="DadosAlocacao.Direcionado.DigitoVerificadorCliente"/>
                        <Controls:Column Name="PercRedAcr"
                                         Title="Bovespa.Alocacao.Label.PercRedAcr"
										 AutoAdjustWidthToContent="False"
										 Width="120"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="DadosAlocacao.Direcionado.PercentualReducaoAcrescimo"/>
                        <Controls:Column Name="Dolar"
                                         Title="Bovespa.Alocacao.Label.Dolar"
										 AutoAdjustWidthToContent="False"
										 Width="100"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="DadosAlocacao.Dolar"/>
                        <Controls:Column Name="IndLiqExternaCliente"
                                         Title="Bovespa.Alocacao.Label.IndLiqExternaCliente"
										 AutoAdjustWidthToContent="False"
										 Width="150"
										 HorizontalCellAlignment="Center"
                                         DisplayMemberPath="DadosAlocacao.IndicadorLiquidacaoExternaCliente"/>
                        <Controls:Column Name="IndSistemaExterno"
                                         Title="Bovespa.Alocacao.Label.IndSistemaExterno"
										 AutoAdjustWidthToContent="False"
										 Width="130"
                                         DisplayMemberPath="DadosAlocacao.IndicadorSistemaExterno"/>
                    </Controls:SinacorDataGrid.Columns>
                </Controls:SinacorDataGrid>
            </Grid>
        </Controls:SinacorExpander>

        <Controls:SinacorExpander Grid.Row="2" Name="Digitacao"
								  Header="{DynamicResource Bovespa.Alocacao.Label.Digitacao}" 
								  Margin="0,4,0,0" 
								  AllowExpand="True" 
								  IsExpanded="True">
            <Grid>
                <Controls:SinacorDataGrid VerticalAlignment="Stretch" 
                                          TabIndex="13"
                                          x:Name="dtgDigitacao"                                                                                    
                                          RowEditMode="AllCells" 
                                          AllowBeginInsert="False" 
                                          AllowBeginUpdate="True"
                                          AllowUndo="True" 
                                          AllowCancelUpdate="False" 
                                          ItemsSource="{Binding ListaDigitacao}"
                                          IsSynchronizedWithCurrentItem="True" 
                                          AllowCancelInsert="True" 
                                          AllowDelete="False" 
                                          AllowEndInsert="True" 
                                          AllowEndUpdate="True" 
                                          AllowSaveAll="True" 
                                          AllowUndoAll="True" 
                                          AllowUndoLast="True"
                                          BeingInserted="dtgDigitacao_BeingInserted"
                                          InsertBegun="dtgDigitacao_InsertBegun"
                                          UpdateBegun="dtgDigitacao_UpdateBegun" 
                                          SavingAll="dtgDigitacao_SavingAll"
                                          Undid="dtgDigitacao_Undid"
                                          UndidAll="dtgDigitacao_UndidAll"
                                          InsertCanceled="dtgDigitacao_InsertCanceled"
                                          UpdateCanceled="dtgDigitacao_InsertCanceled"
                                          >
                    <Controls:SinacorDataGrid.Columns>
                        <Controls:Column Name="Cliente"
                                         Title="Bovespa.Alocacao.Label.Cliente"
										 AutoAdjustWidthToContent="False"
                                         IsRequired="True"
                                         RequiredErrorMessage=""
										 Width="80"
                                         AllowInsert="True"                                         
                                         DisplayMemberPath="Cliente"
                                         MaxLength="7"
                                         AllowUpdate="True"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorInt32TextBox IsFormated="False"
                                                             Integers="7"
                                                             IsRequired="True" 
                                                             x:Name="txtCliente" 
                                                             Value="{Binding Cliente}"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>

                        </Controls:Column>
                        <Controls:Column Name="DV"
                                         Title="Bovespa.Alocacao.Label.DV"
										 AutoAdjustWidthToContent="False"
										 Width="25"
                                         AllowInsert="True"
										 HorizontalCellAlignment="Center"
                                         DisplayMemberPath="DigitoVerificadorCliente"
                                         MaxLength="1"
                                         AllowUpdate="True"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorInt32TextBox IsRequired="True" 
                                                             IsFormated="False"
                                                             Integers="1"
                                                             x:Name="txtDV" 
                                                             Value="{Binding DigitoVerificadorCliente}"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                        <Controls:Column Name="QtdEspecificar"
                                         Title="Bovespa.Alocacao.Label.QtdEspecificar"
										 AutoAdjustWidthToContent="False"
										 Width="130"
                                         AllowInsert="True"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="QuantidadeEspecificar"
                                         Integers="15"
                                         Decimals="4"
                                         AllowUpdate="True"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorDecimalTextBox IsRequired="True" 
                                                                    Integers="15" 
                                                                    Decimals="4"  
                                                                    x:Name="txtQtdEspecificar" 
                                                                    Value="{Binding QuantidadeEspecificar}"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>

                        <Controls:Column Name="TipoLiq"
                                         Title="Bovespa.Alocacao.Label.TipoLiq"
										 AutoAdjustWidthToContent="False"
										 Width="80"
                                         DisplayMemberPath="Direcionado.TipoLiquidacao"
                                         MaxLength="1"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"
                                         AllowInsert="True" 
                                         AllowUpdate="True">
                            <Controls:Column.CellInsertTemplate>

                                <DataTemplate>
                                    <Controls:SinacorComboBox x:Name="cmbTipoLiquidacao" 
                                                              ItemsSource="{ Binding PresenterAlocacaoDireta.ListaTiposLiquidacao, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}} }" 
                                                              SelectedValue="{Binding Direcionado.TipoLiquidacao}" 
                                                              WidthPopup="300" 
                                                              MaxLength="50"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>

                        </Controls:Column>
                        <Controls:Column Name="Carteira"
                                         Title="Bovespa.Alocacao.Label.Carteira"
										 AutoAdjustWidthToContent="False"
										 Width="50"
                                         AllowInsert="True"
                                         MaxLength="3"
                                         AllowUpdate="True"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}"                                         
                                         DisplayMemberPath="Carteira">
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorInt32TextBox IsRequired="True" 
                                                             Integers="3"
                                                             IsFormated="False"
                                                             x:Name="txtCarteira" 
                                                             Value="{Binding Carteira}"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                        <Controls:Column Name="UsuarioDirecionado"
                                         Title="Bovespa.Alocacao.Label.UsuarioDirecionado"
										 HorizontalCellAlignment="Right"
                                         MaxLength="5"
                                         AllowInsert="True"
                                         DisplayMemberPath="Direcionado.Usuario"                                         
                                         AllowUpdate="True"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}" >
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorInt32TextBox IsRequired="False" 
                                                             IsFormated="False"
                                                             Integers="5"
                                                             x:Name="txtDirUsuario" 
                                                             Value="{Binding Direcionado.Usuario}"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                        <Controls:Column Name="ClienteDirecionado"
                                         Title="Bovespa.Alocacao.Label.ClienteDirecionado"
										 HorizontalCellAlignment="Right"
                                         MaxLength="7"
                                         AllowInsert="True"
                                         DisplayMemberPath="Direcionado.Cliente"                                            
                                         AllowUpdate="True"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorInt32TextBox IsRequired="False" 
                                                             IsFormated="False"
                                                             Integers="7"
                                                             x:Name="txtDirCliente" 
                                                             Value="{Binding Direcionado.Cliente}"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                        <Controls:Column Name="DV2"
                                         Title="Bovespa.Alocacao.Label.DV"
										 AutoAdjustWidthToContent="False"
										 Width="25"
                                         AllowInsert="True"
										 HorizontalCellAlignment="Center"
                                         MaxLength="1"
                                         DisplayMemberPath="Direcionado.DigitoVerificadorCliente"                                               
                                         AllowUpdate="True"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}" >
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorInt32TextBox IsRequired="False" 
                                                             IsFormated="False"
                                                             Integers="1"
                                                             x:Name="txtDirDV" 
                                                             Value="{Binding Direcionado.DigitoVerificadorCliente}"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                        <Controls:Column Name="PercRedAcr"
                                         Title="Bovespa.Alocacao.Label.PercRedAcr"
										 AutoAdjustWidthToContent="False"
										 Width="120"
										 HorizontalCellAlignment="Right"
                                         Decimals="8"
                                         Integers="3"
                                         AllowInsert="True"
                                         DisplayMemberPath="Direcionado.PercentualReducaoAcrescimo"                                                                                        
                                         AllowUpdate="True"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorDecimalTextBox IsRequired="True" 
                                                                    Decimals="2" 
                                                                    Integers="3"  
                                                                    x:Name="txtDirUsuario" 
                                                                    Value="{Binding Direcionado.PercentualReducaoAcrescimo}"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                        <Controls:Column Name="Dolar"
                                         Title="Bovespa.Alocacao.Label.Dolar"
										 AutoAdjustWidthToContent="False"
										 Width="100"
										 HorizontalCellAlignment="Right"
                                         MaxLength="7"
                                         DisplayMemberPath="Dolar" 
                                         AllowInsert="True"
                                         Decimals="4" Integers="7"
                                         AllowUpdate="True"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}" >
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorDecimalTextBox IsRequired="False" 
                                                                    Decimals="4" 
                                                                    Integers="7"  
                                                                    x:Name="txtDolar" 
                                                                    Value="{Binding Dolar}"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                        <Controls:Column Name="IndLiqExternaCliente"
                                         Title="Bovespa.Alocacao.Label.IndLiqExternaCliente"
										 AutoAdjustWidthToContent="False"
										 Width="150"
										 HorizontalCellAlignment="Center"
                                         DisplayMemberPath="IndicadorLiquidacaoExternaCliente" 
                                         AllowInsert="True"
                                         AllowUpdate="True"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}">
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorCheckBox  x:Name="chkIndicadorLiquidacaoExternaCliente" 
                                                               IsChecked="{Binding IndicadorLiquidacaoExternaCliente}"
                                                               IsEnabled="True"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                            <Controls:Column.CellTemplate>
                                <DataTemplate>
                                    <Controls:SinacorCheckBox  x:Name="chkIndicadorLiquidacaoExternaClienteVisual" 
                                                               IsChecked="{Binding IndicadorLiquidacaoExternaCliente}"
                                                               IsEnabled="False"/>
                                </DataTemplate>
                            </Controls:Column.CellTemplate>
                        </Controls:Column>
                        <Controls:Column Name="IndSistemaExterno"
                                         Title="Bovespa.Alocacao.Label.IndSistemaExterno"
										 AutoAdjustWidthToContent="False"
										 Width="130"
										 HorizontalCellAlignment="Left"
                                         MaxLength="18"
                                         DisplayMemberPath="IndicadorSistemaExterno" 
                                         AllowInsert="True"
                                         AllowUpdate="True"
                                         CellUpdateTemplate="{Binding Path=CellInsertTemplate, RelativeSource={RelativeSource Self}}" >
                            <Controls:Column.CellInsertTemplate>
                                <DataTemplate>
                                    <Controls:SinacorTextBox IsRequired="False" 
                                                             MaxLength="18"  
                                                             x:Name="txtIndSistemaExterno" 
                                                             Text="{Binding IndicadorSistemaExterno}"/>
                                </DataTemplate>
                            </Controls:Column.CellInsertTemplate>
                        </Controls:Column>
                    </Controls:SinacorDataGrid.Columns>
                </Controls:SinacorDataGrid>

            </Grid>
        </Controls:SinacorExpander>

        <Controls:SinacorExpander Name="NegociosDisponiveis" 
                                  Header="{DynamicResource Bovespa.Alocacao.Label.NegociosDisponiveis}" 
								  Grid.Row="3" 
								  Margin="0,4,0,0" 
								  AllowExpand="True" 
								  IsExpanded="True">
            <Grid>
                <Controls:SinacorDataGrid x:Name="dtgDisponiveis"
                                          TabIndex="14"
                                          ItemsSource="{Binding ListaDisponiveis}"
                                          SelectionChanged="dtgDisponiveis_SelectionChanged">
                    <Controls:SinacorDataGrid.Columns>
                        <Controls:Column Name="NNegocio"
                                         Title="Bovespa.Alocacao.Label.NNegocio"
										 AutoAdjustWidthToContent="False"
										 Width="100"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="Numero"/>
                        <Controls:Column Name="Bolsa"
                                         Title="Bovespa.Alocacao.Label.Bolsa"
										 AutoAdjustWidthToContent="False"
										 Width="40"
										 HorizontalCellAlignment="Center"
                                         DisplayMemberPath="Bolsa"/>
                        <Controls:Column Name="Ativo"
                                         Title="Bovespa.Alocacao.Label.Ativo"
										 AutoAdjustWidthToContent="False"
										 Width="120"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="Codigo"/>
                        <Controls:Column Name="NatOperacao"
                                         Title="Bovespa.Alocacao.Label.NatOperacao"
										 AutoAdjustWidthToContent="False"
										 Width="80"
										 HorizontalCellAlignment="Center"
                                         DisplayMemberPath="NaturezaOperacao"/>
                        <Controls:Column Name="Preco"
                                         Title="Bovespa.Alocacao.Label.Preco"
										 AutoAdjustWidthToContent="False"
										 Width="160"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="Valor"/>
                        <Controls:Column Name="Quantidade"
                                         Title="Bovespa.Alocacao.Label.Quantidade"
										 AutoAdjustWidthToContent="False"
										 Width="130"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="Quantidade" />
                        <Controls:Column Name="QtdCasada"
                                         Title="Bovespa.Alocacao.Label.QtdCasada"
										 AutoAdjustWidthToContent="False"
										 Width="130"
										 HorizontalCellAlignment="Right"
                                         DisplayMemberPath="QuantidadeCasada" />
                        <Controls:Column Name="Mercado"
                                         Title="Bovespa.Alocacao.Label.Mercado"
										 AutoAdjustWidthToContent="False"
										 Width="55"
                                         DisplayMemberPath="Mercado" />
                    </Controls:SinacorDataGrid.Columns>
                </Controls:SinacorDataGrid>
            </Grid>
        </Controls:SinacorExpander>
    </Controls:SinacorExpanderContainer>
</Controls:SinacorWindow>